/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "news_extends_channel_title")
//@NamedQueries({@NamedQuery(name = "NewsExtendsChannelTitle.findAll", query = "SELECT n FROM NewsExtendsChannelTitle n"), @NamedQuery(name = "NewsExtendsChannelTitle.findByChannleid", query = "SELECT n FROM NewsExtendsChannelTitle n WHERE n.newsExtendsChannelTitlePK.channleid = :channleid"), @NamedQuery(name = "NewsExtendsChannelTitle.findByCid", query = "SELECT n FROM NewsExtendsChannelTitle n WHERE n.newsExtendsChannelTitlePK.cid = :cid"), @NamedQuery(name = "NewsExtendsChannelTitle.findByTitleorder", query = "SELECT n FROM NewsExtendsChannelTitle n WHERE n.titleorder = :titleorder"), @NamedQuery(name = "NewsExtendsChannelTitle.findByContentstatus", query = "SELECT n FROM NewsExtendsChannelTitle n WHERE n.contentstatus = :contentstatus"), @NamedQuery(name = "NewsExtendsChannelTitle.findByIstest", query = "SELECT n FROM NewsExtendsChannelTitle n WHERE n.istest = :istest"), @NamedQuery(name = "NewsExtendsChannelTitle.findByIsnew", query = "SELECT n FROM NewsExtendsChannelTitle n WHERE n.isnew = :isnew")})
public class NewsExtendsChannelTitle implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected NewsExtendsChannelTitlePK newsExtendsChannelTitlePK;
    @Column(name = "titleorder")
    private Integer titleorder;
    @Column(name = "contentstatus")
    private Integer contentstatus;
    @Column(name = "istest")
    private Integer istest;
    @Column(name = "isnew")
    private Integer isnew;
    @OneToMany(mappedBy = "newsExtendsChannelTitle")
    private Set<NewsComment> newsCommentSet;
    @JoinColumn(name = "channleid", referencedColumnName = "channleid", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private NewsExtendsChannel newsExtendsChannel;
    @JoinColumn(name = "cid", referencedColumnName = "cid", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private NewsContenttitle newsContenttitle;
    @OneToMany(mappedBy = "newsExtendsChannelTitle")
    private Set<NewsPoint> newsPointSet;

    public NewsExtendsChannelTitle() {
    }

    public NewsExtendsChannelTitle(NewsExtendsChannelTitlePK newsExtendsChannelTitlePK) {
        this.newsExtendsChannelTitlePK = newsExtendsChannelTitlePK;
    }

    public NewsExtendsChannelTitle(int channleid, int cid) {
        this.newsExtendsChannelTitlePK = new NewsExtendsChannelTitlePK(channleid, cid);
    }

    public NewsExtendsChannelTitlePK getNewsExtendsChannelTitlePK() {
        return newsExtendsChannelTitlePK;
    }

    public void setNewsExtendsChannelTitlePK(NewsExtendsChannelTitlePK newsExtendsChannelTitlePK) {
        this.newsExtendsChannelTitlePK = newsExtendsChannelTitlePK;
    }

    public Integer getTitleorder() {
        return titleorder;
    }

    public void setTitleorder(Integer titleorder) {
        this.titleorder = titleorder;
    }

    public Integer getContentstatus() {
        return contentstatus;
    }

    public void setContentstatus(Integer contentstatus) {
        this.contentstatus = contentstatus;
    }

    public Integer getIstest() {
        return istest;
    }

    public void setIstest(Integer istest) {
        this.istest = istest;
    }

    public Integer getIsnew() {
        return isnew;
    }

    public void setIsnew(Integer isnew) {
        this.isnew = isnew;
    }

    public Set<NewsComment> getNewsCommentSet() {
        return newsCommentSet;
    }

    public void setNewsCommentSet(Set<NewsComment> newsCommentSet) {
        this.newsCommentSet = newsCommentSet;
    }

    public NewsExtendsChannel getNewsExtendsChannel() {
        return newsExtendsChannel;
    }

    public void setNewsExtendsChannel(NewsExtendsChannel newsExtendsChannel) {
        this.newsExtendsChannel = newsExtendsChannel;
    }

    public NewsContenttitle getNewsContenttitle() {
        return newsContenttitle;
    }

    public void setNewsContenttitle(NewsContenttitle newsContenttitle) {
        this.newsContenttitle = newsContenttitle;
    }

    public Set<NewsPoint> getNewsPointSet() {
        return newsPointSet;
    }

    public void setNewsPointSet(Set<NewsPoint> newsPointSet) {
        this.newsPointSet = newsPointSet;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (newsExtendsChannelTitlePK != null ? newsExtendsChannelTitlePK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewsExtendsChannelTitle)) {
            return false;
        }
        NewsExtendsChannelTitle other = (NewsExtendsChannelTitle) object;
        if ((this.newsExtendsChannelTitlePK == null && other.newsExtendsChannelTitlePK != null) || (this.newsExtendsChannelTitlePK != null && !this.newsExtendsChannelTitlePK.equals(other.newsExtendsChannelTitlePK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.NewsExtendsChannelTitle[newsExtendsChannelTitlePK=" + newsExtendsChannelTitlePK + "]";
    }

}
